package cValidator

import (
	"github.com/go-playground/validator/v10"

	"gitee.com/csingo/cComponents"
)

type ValidatorComponent struct{}

func (i *ValidatorComponent) Inject(instance any) bool {
	if container.Is(instance) {
		return container.Save(instance)
	}

	return false
}

func (i *ValidatorComponent) InjectConf(config cComponents.ConfigInterface) bool {
	return false
}

func (i *ValidatorComponent) Load() {
	Verifier = validator.New()
}

func (i *ValidatorComponent) Listen() []*cComponents.ConfigListener {
	return nil
}

var Component = &ValidatorComponent{}
